﻿using System;
using System.Linq;

namespace Wala.Infrastructure
{
    public class Constants
    {
        public const String VERSION_PROTOCOL = "1.145";

        public class ClientMessageType
        {
            public const int
            // Login logout
            RET_LOGIN_SUCCESS_MSG = 100,
            RET_LOGIN_ERROR_MSG = 101,
            RET_LOGOUT_SUCCESS_MSG = 102,
            RET_LOGOUT_ERROR_MSG = 103,
            RET_RECONNECT_SUCCESS_MSG = 104,
            RET_RECONNECT_ERROR_MSG = 105,
            // Load contact etc...
            RET_LOAD_CONTACT_SUCCESS_MSG = 110,
            RET_LOAD_CONTACT_ERROR_MSG = 111,
            RET_LOAD_PRESENCE_SUCCESS_MSG = 112,
            RET_LOAD_PRESENCE_ERROR_MSG = 113,
            RET_LOAD_FRIEND_BASIC_SUCCESS_MSG = 114,
            RET_LOAD_FRIEND_BASIC_ERROR_MSG = 115,
            RET_LOAD_FRIEND_DETAIL_SUCCESS_MSG = 116,
            RET_LOAD_FRIEND_DETAIL_ERROR_MSG = 117,
            RET_LOAD_FRIEND_PRESENCE_SUCCESS_MSG = 118,
            RET_LOAD_FRIEND_PRESENCE_ERROR_MSG = 119,
            // User profile
            RET_GET_USER_SUCCESS_MSG = 120,
            RET_GET_USER_ERROR_MSG = 121,
            RET_UPDATE_USER_INFO_SUCCESS_MSG = 122,
            RET_UPDATE_USER_INFO_ERROR_MSG = 123,
            RET_CHANGE_PASSWORD_SUCCESS_MSG = 124,
            RET_CHANGE_PASSWORD_ERROR_MSG = 125,
            RET_UPDATE_AVATAR_SUCCESS_MSG = 126,
            RET_UPDATE_AVATAR_ERROR_MSG = 127,
            RET_UPDATE_COVER_SUCCESS_MSG = 128,
            RET_UPDATE_COVER_ERROR_MSG = 129,
            // Friend
            RET_ADD_FRIEND_SUCCESS_MSG = 130,
            RET_ADD_FRIEND_ERROR_MSG = 131,
            RET_DELETE_FRIEND_SUCCESS_MSG = 132,
            RET_DELETE_FRIEND_ERROR_MSG = 133,
            RET_ACCEPT_FRIEND_SUCCESS_MSG = 134,
            RET_ACCEPT_FRIEND_ERROR_MSG = 135,
            RET_REJECT_FRIEND_SUCCESS_MSG = 136,
            RET_REJECT_FRIEND_ERROR_MSG = 137,
            RET_ADD_FRIEND_ID_SUCCESS_MSG = 138,
            RET_ADD_FRIEND_ID_ERROR_MSG = 139,
            RET_SET_FRIEND_ALIAS_SUCCESS_MSG = 140,
            RET_SET_FRIEND_ALIAS_ERROR_MSG = 141,
            RET_SET_FRIEND_ALIAS_LIST_SUCCESS_MSG = 142,
            RET_SET_FRIEND_ALIAS_LIST_ERROR_MSG = 143,
            RET_GET_PENDING_FRIEND_SUCCESS_MSG = 144,
            RET_GET_PENDING_FRIEND_ERROR_MSG = 145,
            // Contact group
            RET_ADD_CONTACT_GROUP_SUCCESS_MSG = 150,
            RET_ADD_CONTACT_GROUP_ERROR_MSG = 151,
            RET_UPDATE_CONTACT_GROUP_SUCCESS_MSG = 152,
            RET_UPDATE_CONTACT_GROUP_ERROR_MSG = 153,
            RET_DELETE_CONTACT_GROUP_SUCCESS_MSG = 154,
            RET_DELETE_CONTACT_GROUP_ERROR_MSG = 155,
            RET_ADD_USER_CG_SUCCESS_MSG = 156,
            RET_ADD_USER_CG_ERROR_MSG = 157,
            RET_DELETE_USER_CG_SUCCESS_MSG = 158,
            RET_DELETE_USER_CG_ERROR_MSG = 159,
            RET_MOVE_USER_CG_SUCCESS_MSG = 160,
            RET_MOVE_USER_CG_ERROR_MSG = 161,
            // Status
            RET_UPDATE_PRESENCE_SUCCESS_MSG = 170,
            RET_UPDATE_PRESENCE_ERROR_MSG = 171,
            // Register phone book
            RET_REGISTER_PHONEBOOK_SUCCESS_MSG = 180,
            RET_REGISTER_PHONEBOOK_ERROR_MSG = 181,
            // Chat
            RET_SEND_PAIR_CHAT_SUCCESS_MSG = 200,
            RET_SEND_PAIR_CHAT_ERROR_MSG = 201,
            RECV_PAIR_CHAT_MSG = 202,
            // Group chat
            RET_CREATE_GROUP_SUCCESS_MSG = 203,
            RET_CREATE_GROUP_ERROR_MSG = 204,
            RET_INVITE_TO_GROUP_SUCCESS_MSG = 205,
            RET_INVITE_TO_GROUP_ERROR_MSG = 206,
            RET_RESPONSE_GROUP_INVITATION_SUCCESS_MSG = 207,
            RET_RESPONSE_GROUP_INVITATION_ERROR_MSG = 208,
            RET_LEAVE_GROUP_SUCCESS_MSG = 209,
            RET_LEAVE_GROUP_ERROR_MSG = 210,
            RET_SEND_GROUP_CHAT_SUCCESS_MSG = 211,
            RET_SEND_GROUP_CHAT_ERROR_MSG = 212,
            RECV_GROUP_CHAT_MSG = 213,
            RET_GET_GROUP_MEMBER_LIST_SUCCESS_MSG = 214,
            RET_GET_GROUP_MEMBER_LIST_ERROR_MSG = 215,
            RET_REMOVE_GROUP_MEMBER_SUCCESS_MSG = 216,
            RET_REMOVE_GROUP_MEMBER_ERROR_MSG = 217,
            // Location chat
            RET_SET_LOCATION_SUCCESS_MSG = 300,
            RET_SET_LOCATION_ERROR_MSG = 301,
            RET_REMOVE_LOCATION_SUCCESS_MSG = 302,
            RET_REMOVE_LOCATION_ERROR_MSG = 303,
            RET_SEARCH_LOCATION_CHAT_SUCCESS_MSG = 304,
            RET_SEARCH_LOCATION_CHAT_ERROR_MSG = 305,
            // Offline
            RET_PAIR_OFFLINE_MSG = 400,
            RET_GROUP_OFFLINE_MSG = 401,
            // Conversation group
            RET_LOAD_CONVERSATION_GROUP_SUCCESS_MSG = 410,
            RET_LOAD_CONVERSATION_GROUP_ERROR_MSG = 411,
            RET_ADD_CONVERSATION_GROUP_SUCCESS_MSG = 412,
            RET_ADD_CONVERSATION_GROUP_ERROR_MSG = 413,
            RET_UPDATE_CONVERSATION_GROUP_SUCCESS_MSG = 414,
            RET_UPDATE_CONVERSATION_GROUP_ERROR_MSG = 415,
            RET_DELETE_CONVERSATION_GROUP_SUCCESS_MSG = 416,
            RET_DELETE_CONVERSATION_GROUP_ERROR_MSG = 417,
            // Notify message to client
            NOTIFY_ONLINE_MSG = 500,
            NOTIFY_OFFLINE_MSG = 501,
            NOTIFY_FRIEND_REQUEST_MSG = 502,
            NOTIFY_GENERAL_MSG = 503,
            NOTIFY_UPDATE_PRESENCE_MSG = 504,
            NOTIFY_PAIR_OFFLINE_MSG = 505,
            NOTIFY_INVITE_TO_GROUP_MSG = 506,
            NOTIFY_GROUP_OFFLINE_MSG = 507,
            NOTIFY_GROUP_CHANGE_MSG = 508,
            NOTIFY_UPDATE_AVATAR_MSG = 509,
            NOTIFY_UPDATE_COVER_MSG = 510,
            // Kick message
            KICK_MSG = 600,
            CLIENT_PONG_SUCCESS_MSG = 601,
            CLIENT_PONG_ERROR_MSG = 602,
            // Misc
            RET_GET_SHORT_PROFILE_SUCCESS_MSG = 700,
            RET_GET_SHORT_PROFILE_ERROR_MSG = 701,
            RET_GET_SHORT_PROFILE_LIST_SUCCESS_MSG = 702,
            RET_GET_SHORT_PROFILE_LIST_ERROR_MSG = 703,
            // Privacy
            RET_SET_USER_PRIVACY_SUCCESS_MSG = 710,
            RET_SET_USER_PRIVACY_ERROR_MSG = 711,
            RET_GET_USER_PRIVACY_SUCCESS_MSG = 712,
            RET_GET_USER_PRIVACY_ERROR_MSG = 713,
            RET_BLOCK_USER_SUCCESS_MSG = 714,
            RET_BLOCK_USER_ERROR_MSG = 715,
            RET_UNBLOCK_USER_SUCCESS_MSG = 716,
            RET_UNBLOCK_USER_ERROR_MSG = 717,
            // IOS
            RET_IOS_HOME_SUCCESS_MSG = 720,
            RET_IOS_HOME_ERROR_MSG = 721,
            RET_IOS_ALIVE_SUCCESS_MSG = 722, RET_IOS_ALIVE_ERROR_MSG = 723;
        }

        public class InvitationResponseState
        {
            public const int RESPONSE_ACCEPT = 1, RESPONSE_REJECT = 2;
        }

        public class GroupMemberChangeType
        {
            public const int JOIN_GROUP = 1, LEAVE_GROUP = 2,
            KICK_GROUP = 3;
        }

        public class CommMessageType
        {
            // Message to com server: 1001 - 2000
            public const int
            // Message send from client
            // Login logout
            LOGIN_MSG = 1001,
            LOGOUT_MSG = 1002,
            RECONNECT_MSG = 1003,
            // Load contact etc...
            LOAD_CONTACT_MSG = 1010,
            LOAD_PRESENCE_MSG = 1011,
            LOAD_FRIEND_BASIC_MSG = 1012,
            LOAD_FRIEND_DETAIL_MSG = 1013,
            LOAD_FRIEND_PRESENCE_MSG = 1014,
            // User profile
            GET_USER_MSG = 1020,
            UPDATE_USER_INFO_MSG = 1021,
            CHANGE_PASSWORD_MSG = 1022,
            UPDATE_AVATAR_MSG = 1023,
            UPDATE_COVER_MSG = 1024,
            // Privacy
            SET_USER_PRIVACY_MSG = 1025,
            GET_USER_PRIVACY_MSG = 1026,
            BLOCK_USER_MSG = 1027,
            UNBLOCK_USER_MSG = 1028,
            // Friend
            ADD_FRIEND_MSG = 1030,
            DELETE_FRIEND_MSG = 1031,
            ACCEPT_FRIEND_MSG = 1032,
            REJECT_FRIEND_MSG = 1033,
            ADD_FRIEND_ID_MSG = 1034,
            SET_FRIEND_ALIAS_MSG = 1035,
            SET_FRIEND_ALIAS_LIST_MSG = 1036,
            GET_PENDING_FRIEND_MSG = 1037,
            // Contact group
            ADD_CONTACT_GROUP_MSG = 1040,
            UPDATE_CONTACT_GROUP_MSG = 1041,
            DELETE_CONTACT_GROUP_MSG = 1042,
            ADD_USER_CG_MSG = 1043,
            DELETE_USER_CG_MSG = 1044,
            MOVE_USER_CG_MSG = 1045,
            // Status
            UPDATE_PRESENCE_MSG = 1050,
            // Load offline message
            LOAD_OFFLINE_MSG = 1051,
            // Register phone book
            REGISTER_PHONEBOOK_MSG = 1052,
            // Chat
            SEND_PAIR_CHAT_MSG = 1053,
            // Group chat
            CREATE_GROUP_MSG = 1060,
            INVITE_TO_GROUP_MSG = 1061,
            RESPONSE_GROUP_INVITATION_MSG = 1062,
            LEAVE_GROUP_MSG = 1063,
            SEND_GROUP_CHAT_MSG = 1064,
            GET_GROUP_MEMBER_LIST_MSG = 1065,
            REMOVE_GROUP_MEMBER_MSG = 1066,
            // Location chat
            SET_LOCATION_MSG = 1070,
            REMOVE_LOCATION_MSG = 1071,
            SEARCH_LOCATION_CHAT_MSG = 1072,
            // Misc
            GET_SHORT_PROFILE_MSG = 1080,
            GET_SHORT_PROFILE_LIST_MSG = 1081,
            CLIENT_PING_MSG = 1090,
            // Conversation group
            LOAD_CONVERSATION_GROUP_MSG = 1091,
            ADD_CONVERSATION_GROUP_MSG = 1092,
            UPDATE_CONVERSATION_GROUP_MSG = 1093,
            DELETE_CONVERSATION_GROUP_MSG = 1094,
            // IOS
            IOS_HOME_MSG = 1095,
            IOS_ALIVE_MSG = 1096,

            // Return message from presence server
            // Login logout
            RET_INIT_PRESENCE_SUCCESS_MSG = 1100,
            RET_INIT_PRESENCE_ERROR_MSG = 1101,
            RET_TERMINATE_PRESENCE_SUCCESS_MSG = 1102,
            RET_TERMINATE_PRESENCE_ERROR_MSG = 1103,
            RET_RECONNECT_SUCCESS_MSG = 1104,
            RET_RECONNECT_ERROR_MSG = 1105,
            // Load contact etc...
            RET_LOAD_CONTACT_SUCCESS_MSG = 1110,
            RET_LOAD_CONTACT_ERROR_MSG = 1111,
            RET_LOAD_PRESENCE_SUCCESS_MSG = 1112,
            RET_LOAD_PRESENCE_ERROR_MSG = 1113,
            RET_LOAD_FRIEND_BASIC_SUCCESS_MSG = 1114,
            RET_LOAD_FRIEND_BASIC_ERROR_MSG = 1115,
            RET_LOAD_FRIEND_DETAIL_SUCCESS_MSG = 1116,
            RET_LOAD_FRIEND_DETAIL_ERROR_MSG = 1117,
            RET_LOAD_FRIEND_PRESENCE_SUCCESS_MSG = 1118,
            RET_LOAD_FRIEND_PRESENCE_ERROR_MSG = 1119,
            // User profile
            RET_GET_USER_SUCCESS_MSG = 1120,
            RET_GET_USER_ERROR_MSG = 1121,
            RET_ADD_USER_SUCCESS_MSG = 1122,
            RET_ADD_USER_ERROR_MSG = 1123,
            RET_UPDATE_USER_PROFILE_SUCCESS_MSG = 1124,
            RET_UPDATE_USER_PROFILE_ERROR_MSG = 1125,
            RET_UPDATE_USER_INFO_SUCCESS_MSG = 1126,
            RET_UPDATE_USER_INFO_ERROR_MSG = 1127,
            RET_CHANGE_PASSWORD_SUCCESS_MSG = 1128,
            RET_CHANGE_PASSWORD_ERROR_MSG = 1129,
            RET_DELETE_USER_SUCCESS_MSG = 1130,
            RET_DELETE_USER_ERROR_MSG = 1131,
            RET_UPDATE_AVATAR_SUCCESS_MSG = 1132,
            RET_UPDATE_AVATAR_ERROR_MSG = 1133,
            RET_UPDATE_COVER_SUCCESS_MSG = 1134,
            RET_UPDATE_COVER_ERROR_MSG = 1135,
            RET_NEW_PASSWORD_SUCCESS_MSG = 1136,
            RET_NEW_PASSWORD_ERROR_MSG = 1137,
            // Friend
            RET_ADD_FRIEND_SUCCESS_MSG = 1140,
            RET_ADD_FRIEND_ERROR_MSG = 1141,
            RET_DELETE_FRIEND_SUCCESS_MSG = 1142,
            RET_DELETE_FRIEND_ERROR_MSG = 1143,
            RET_ACCEPT_FRIEND_SUCCESS_MSG = 1144,
            RET_ACCEPT_FRIEND_ERROR_MSG = 1145,
            RET_REJECT_FRIEND_SUCCESS_MSG = 1146,
            RET_REJECT_FRIEND_ERROR_MSG = 1147,
            RET_ADD_FRIEND_ID_SUCCESS_MSG = 1148,
            RET_ADD_FRIEND_ID_ERROR_MSG = 1149,
            RET_SET_FRIEND_ALIAS_SUCCESS_MSG = 1150,
            RET_SET_FRIEND_ALIAS_ERROR_MSG = 1151,
            RET_SET_FRIEND_ALIAS_LIST_SUCCESS_MSG = 1152,
            RET_SET_FRIEND_ALIAS_LIST_ERROR_MSG = 1153,
            RET_GET_PENDING_FRIEND_SUCCESS_MSG = 1154,
            RET_GET_PENDING_FRIEND_ERROR_MSG = 1155,
            // Contact group
            RET_ADD_CONTACT_GROUP_SUCCESS_MSG = 1160,
            RET_ADD_CONTACT_GROUP_ERROR_MSG = 1161,
            RET_UPDATE_CONTACT_GROUP_SUCCESS_MSG = 1162,
            RET_UPDATE_CONTACT_GROUP_ERROR_MSG = 1163,
            RET_DELETE_CONTACT_GROUP_SUCCESS_MSG = 1164,
            RET_DELETE_CONTACT_GROUP_ERROR_MSG = 1165,
            RET_ADD_USER_CG_SUCCESS_MSG = 1166,
            RET_ADD_USER_CG_ERROR_MSG = 1167,
            RET_DELETE_USER_CG_SUCCESS_MSG = 1168,
            RET_DELETE_USER_CG_ERROR_MSG = 1169,
            RET_MOVE_USER_CG_SUCCESS_MSG = 1170,
            RET_MOVE_USER_CG_ERROR_MSG = 1171,
            // Status
            RET_UPDATE_PRESENCE_SUCCESS_MSG = 1180,
            RET_UPDATE_PRESENCE_ERROR_MSG = 1181,
            // Register phone book
            RET_REGISTER_PHONEBOOK_SUCCESS_MSG = 1190,
            RET_REGISTER_PHONEBOOK_ERROR_MSG = 1191,

            // Return message from channel server
            // Chat
            RET_SEND_PAIR_CHAT_SUCCESS_MSG = 1200,
            RET_SEND_PAIR_CHAT_ERROR_MSG = 1201,
            RECV_PAIR_CHAT_MSG = 1202,
            // Group chat
            RET_CREATE_GROUP_SUCCESS_MSG = 1203,
            RET_CREATE_GROUP_ERROR_MSG = 1204,
            RET_INVITE_TO_GROUP_SUCCESS_MSG = 1205,
            RET_INVITE_TO_GROUP_ERROR_MSG = 1206,
            RET_RESPONSE_GROUP_INVITATION_SUCCESS_MSG = 1207,
            RET_RESPONSE_GROUP_INVITATION_ERROR_MSG = 1208,
            RET_LEAVE_GROUP_SUCCESS_MSG = 1209,
            RET_LEAVE_GROUP_ERROR_MSG = 1210,
            RET_GROUP_CHANGE_SUCCESS_MSG = 1211,
            RET_GROUP_CHANGE_ERROR_MSG = 1212,
            RET_SEND_GROUP_CHAT_SUCCESS_MSG = 1215,
            RET_SEND_GROUP_CHAT_ERROR_MSG = 1216,
            RECV_GROUP_CHAT_MSG = 1217,
            RET_GET_GROUP_MEMBER_LIST_SUCCESS_MSG = 1218,
            RET_GET_GROUP_MEMBER_LIST_ERROR_MSG = 1219,
            RET_REMOVE_GROUP_MEMBER_SUCCESS_MSG = 1220,
            RET_REMOVE_GROUP_MEMBER_ERROR_MSG = 1221,

            // Return message from location chat server
            RET_SET_LOCATION_SUCCESS_MSG = 1300,
            RET_SET_LOCATION_ERROR_MSG = 1301,
            RET_REMOVE_LOCATION_SUCCESS_MSG = 1302,
            RET_REMOVE_LOCATION_ERROR_MSG = 1303,
            RET_SEARCH_LOCATION_CHAT_SUCCESS_MSG = 1304,
            RET_SEARCH_LOCATION_CHAT_ERROR_MSG = 1305,

            // Offline message
            RET_GROUP_OFFLINE_MSG = 1401,
            RET_PAIR_OFFLINE_MSG = 1402,

            // Notify message to client
            // From presence server
            NOTIFY_ONLINE_MSG = 1500,
            NOTIFY_OFFLINE_MSG = 1501,
            NOTIFY_FRIEND_REQUEST_MSG = 1502,
            NOTIFY_GENERAL_MSG = 1503,
            NOTIFY_UPDATE_PRESENCE_MSG = 1504,
            NOTIFY_UPDATE_AVATAR_MSG = 1505,
            NOTIFY_UPDATE_COVER_MSG = 1506,
            // From channel server
            NOTIFY_PAIR_OFFLINE_MSG = 1510,
            NOTIFY_GROUP_OFFLINE_MSG = 1511,
            NOTIFY_INVITE_TO_GROUP_MSG = 1512,
            NOTIFY_GROUP_CHANGE_MSG = 1513,
            NOTIFY_GENERAL_LIST_MSG = 1514,

            // Special messages
            FORCE_KICK_MSG = 1520,
            ADMIN_KICK_USER_MSG = 1521,
            ADMIN_CHECK_COM_STATUS_MSG = 1522,

            // Misc
            RET_GET_SHORT_PROFILE_SUCCESS_MSG = 1600,
            RET_GET_SHORT_PROFILE_ERROR_MSG = 1601,
            RET_GET_SHORT_PROFILE_LIST_SUCCESS_MSG = 1602,
            RET_GET_SHORT_PROFILE_LIST_ERROR_MSG = 1603,

            // conversation group
            RET_LOAD_CONVERSATION_GROUP_SUCCESS_MSG = 1700,
            RET_LOAD_CONVERSATION_GROUP_ERROR_MSG = 1701,
            RET_ADD_CONVERSATION_GROUP_SUCCESS_MSG = 1702,
            RET_ADD_CONVERSATION_GROUP_ERROR_MSG = 1703,
            RET_UPDATE_CONVERSATION_GROUP_SUCCESS_MSG = 1704,
            RET_UPDATE_CONVERSATION_GROUP_ERROR_MSG = 1705,
            RET_DELETE_CONVERSATION_GROUP_SUCCESS_MSG = 1706,
            RET_DELETE_CONVERSATION_GROUP_ERROR_MSG = 1707,

            // Privacy
            RET_SET_USER_PRIVACY_SUCCESS_MSG = 1710,
            RET_SET_USER_PRIVACY_ERROR_MSG = 1711,
            RET_GET_USER_PRIVACY_SUCCESS_MSG = 1712,
            RET_GET_USER_PRIVACY_ERROR_MSG = 1713,
            RET_BLOCK_USER_SUCCESS_MSG = 1714,
            RET_BLOCK_USER_ERROR_MSG = 1715,
            RET_UNBLOCK_USER_SUCCESS_MSG = 1716,
            RET_UNBLOCK_USER_ERROR_MSG = 1717;
        }

        public class UserState
        {
            public const int USER_STATE_OFFLINE = 0, USER_STATE_ONLINE = 1,
            USER_STATE_READY = 2;
        }

        public class ACKCode
        {
            public const int ACK_OK = 1;
        }

        public class TimeLineErrorCode
        {
            public const int SUCCESS = 0;
            public const int DATABASE_ERROR = 1;
            public const int GLOBAL_CACHE_ERROR = 2;
            public const int TYPE_ERROR = 3;
            public const int PARSE_ERROR = 4;
            public const int KEY_NOT_FOUND_ERROR = 5;
            public const int USER_NOT_FOUND_ERROR = 6;
            public const int OBJECT_NOT_FOUND_ERROR = 7;
            public const int ALBUM_NOT_FOUND_ERROR = 8;
            public const int CATEGORY_NOT_FOUND_ERROR = 9;
            public const int FEED_NOT_FOUND_ERROR = 10;
            public const int PHOTO_NOT_FOUND_ERROR = 11;
            public const int COMMENT_NOT_FOUND_ERROR = 12;
            public const int LIKE_NOT_FOUND_ERROR = 13;
            public const int TAG_NOT_FOUND_ERROR = 14;
            public const int SHARE_NOT_FOUND_ERROR = 15;
            public const int LIKE_DUPLICATE_ERROR = 16;
            public const int TAG_DUPLICATE_ERROR = 17;
            public const int ARGUMENT_ERROR = 18;
            public const int SEND_ERROR = 19;
            public const int PRIVACY_ERROR = 20;
        }

        public class ErrorCode
        {
            // NOTE: < 10000: internal error. IF THESE ERRORS OCCUR, RETURN
            // SERVER_ERROR (10000)
            public const int
            // NOTE: < 10000: internal error. IF THESE ERRORS OCCUR, RETURN
            // SERVER_ERROR (10000)
            UNKNOWN_ERROR = 2,
            PARSE_ERROR = 3, // Error when parsing message.
            SESSION_NOT_FOUND_ERROR = 4, // Error if session not found in
            // map (user session, presence
            // session)
            SESSION_EXIST = 5,
            DATABASE_ERROR = 6, // Database error.
            DATABASE_KEY_NOT_FOUND = 7,
            DATABASE_KEY_DUP = 8,
            GLOBAL_CACHE_ERROR = 9,
            GLOBAL_CACHE_KEY_NOT_FOUND = 10,
            GLOBAL_CACHE_KEY_DUP = 11,
            CHUNK_ERROR = 12,

            SYSTEM_ERROR = 2012, // WTF

            // >= 10000: user error.
            SERVER_ERROR = 10000, // Generic error for client.

            TOKEN_ERROR = 10001,
            USER_NOT_EXIST = 10002,
            USER_EXIST = 10003,
            FRIEND_NOT_EXIST = 10004,
            FRIEND_EXIST = 10005,
            CONTACT_GROUP_NOT_EXIST = 10006,
            CONTACT_GROUP_EXIST = 10007,
            INPUT_ERROR = 10008,
            REQUEST_NOT_EXIST = 10009,
            GROUP_CHAT_NOT_EXIST = 10010,

            MULTIPLE_SIGN_IN = 10011,
            PASSWORD_COINCIDE = 10012,
            PASSWORD_INCORRECT = 10013,
            PHONE_EXIST = 10014,
            PHONE_NOT_EXIST = 10015, AUTO_ADD_FRIEND_ERROR = 10016,

            USER_SESSION_NOT_FOUND = 15000,
            MALFORM_MESSAGE = 16000,
            PROTOCOL_VERSION_NOT_MATCH = 17000, PROFILE_NOT_ACTIVE = 20000;
        }

        public class FriendState
        {
            public const int FRIEND_STATE_NORMAL = 1,
            FRIEND_STATE_PENDING = 2, FRIEND_STATE_REJECT = 3,
            FRIEND_STATE_NEW = 1000;
        }

        public class NotifyCode
        {
            public const int NOTIFY_CODE_FRIEND_ACCEPT = 1,
            NOTIFY_CODE_FRIEND_REJECT = 2, NOTIFY_CODE_AUTO_ADD_FRIEND = 3;
        }

        public class PhotoSharingNotifyCode
        {
            public const int NOTIFY_CODE_CREATE_PHOTO = 100,
            NOTIFY_CODE_CREATE_COMMENT = 101, NOTIFY_CODE_LIKE = 102,
            NOTIFY_CODE_SHARE = 103, NOTIFY_CODE_TAG = 104,
            NOTIFY_CODE_CREATE_STATUS = 105;
        }

        public class NotificationMessageType
        {
            public const int CREATE_PHOTO = 1, // "%s đã upload ảnh %s"
            CREATE_STATUS = 2, // "%s đã cập nhật trạng thái: \"%s\""
            CREATE_COMMENT_PHOTO = 3, // "%s đã bình luận lên ảnh %s của %s"
            CREATE_COMMENT_PHOTO_SELF = 4, // "%s đã bình luận lên ảnh %s của bạn"
            CREATE_COMMENT_STATUS = 5, // "%s đã bình luận lên trạng thái của %s"
            CREATE_COMMENT_STATUS_SELF = 6, // "%s đã bình luận lên trạng thái của bạn"
            LIKE_PHOTO = 7, // "%s thích ảnh %s của %s
            LIKE_PHOTO_SELF = 8, // "%s thích ảnh %s của bạn"
            LIKE_STATUS = 9, // "%s thích trạng thái của %s"
            LIKE_STATUS_SELF = 10, // "%s thích trạng thái của bạn"
            TAG_PHOTO = 11, // "%s tag %s lên ảnh %s của %s"
            TAG_PHOTO_SELF = 12, // "%s tag %s lên ảnh %s của bạn"
            TAG_PHOTO_RECIPIENT = 13, // "%s tag bạn lên ảnh %s của %s"
            TAG_PHOTO_RECIPIENT_SELF = 14, // "%s tag bạn lên ảnh %s của bạn"
            TAG_STATUS = 15, // "%s tag %s lên trạng thái của %s"
            TAG_STATUS_SELF = 16, // "%s tag %s lên trạng thái của bạn"
            TAG_STATUS_RECIPIENT = 17, // "%s tag bạn lên trạng thái của %s"
            TAG_STATUS_RECIPIENT_SELF = 18, // "%s tag bạn lên trạng thái của bạn"
            ACCEPT_FRIEND = 19, // "%s đã đồng ý kết bạn"
            REJECT_FRIEND = 20, // "%s đã từ chối kết bạn"
            AUTO_ADD_USER_FRIEND_0 = 21, // "Không tìm thấy bạn trong phone book"
            AUTO_ADD_USER_FRIEND_1 = 22, // "%s đã tham gia hệ thống"
            AUTO_ADD_USER_FRIEND_2 = 23, // "Bạn đã kết bạn với %s và %s"
            AUTO_ADD_USER_FRIEND_3 = 24; // "Bạn đã kết bạn với %s, %s và %d người khác"
        }

        public class UserProfileStatus
        {
            public const int USER_PROFILE_STATUS_ACTIVE = 1,
            USER_PROFILE_STATUS_INACTIVE = 2,
            USER_PROFILE_STATUS_BANNED = 3;
        }

        public class PresenceCode
        {
            public const uint PRESENCE_OFFLINE = 0, PRESENCE_INVISIBLE = 1,
            PRESENCE_AVAILABLE = 2, PRESENCE_BUSY = 3, PRESENCE_IDLE = 4;
        }

        public class Response
        {
            public const int DONT_KNOWN_HOST = -1,
            COULD_NOT_IO_TO_HOST = -2, CONECTION_LOST = -3,
            CONECTION_SUCCESS = 0, SEVER_RESPONSE = 1,
            TIMEOUT_CONNECTION = -4, SEND_LOGOUT_SUCCESS = 2;
        }

        public class Gender
        {
            public const int GENDER_UNDEFINED = 0, GENDER_MALE = 1,
            GENDER_FEMALE = 2;
        }

        public class Sort
        {
            public const int SORT_BY_DISTANCE = 0, SORT_BY_TIME = 1;
        }

        public const String PACKAGE_NAME = "wala.chat";
        public const String SETTING_NOTIFY_MODE = "setting_notification";

        public const String CHAT_FRIEND_ID = "friendId";
        public const String CHAT_FRIEND_NAME = "friendName";
        public const String CHAT_FRIEND_AVATAR = "friendAvatarId";
        public const String CHAT_FRIEND_COVER = "friendCoverId";

        public const String CHAT_GROUP_OWNER_ID = "wala_group_owner";
        public const String CHAT_GROUP_ID = "wala_group_id";
        public const String CONTACT_GROUP_ID = "wala_contact_group_id";
        public const String CHOSEND_FRIEND_ID = "wala_chosen_friend_id";
        public const String SEND_TO_CONTACT_GROUP = "send_to_contact_group";
        public const String ADD_FRIEND_TO_CONTACT_GROUP = "add_friend_to_contg";
        public const String MEMBER_IN_CONTACT_GROUP = "member_in_contactGroup";
        public const String NEW_MEMBER_IN_CONTACT_GROUP = "new_member_in_contactGroup";
        public const String RETURN_TO_ADD_CONTGROUP = "return_to_add_contact_group";
        public const String CHAT_GROUP_RENAME = "chat_group_rename";

        public const String FEED_ID = "feed_id";
        public const String PHOTO_DATA = "photo_data";
        public const String FEED_LINK_DETAIL = "feed_link_detail";
        public const String PHOTO = "photo";
        public const String FEED_TYPE = "feedType";
        public const String FEED_DATA = "feed_data";
        public const String MESSAGE_ID = "message_id";

        public const String AUTO_LOGIN = "auto_login";
        public const String AUTO_LOGIN_ID = "wala_user_id";
        public const String AUTO_LOGIN_USERNAME = "wala_user_name";
        public const String AUTO_LOGIN_PASSWORD = "wala_user_password";

        public const String SHUTDOWN_CMD = PACKAGE_NAME + ".SHUTDOWN";

        public const String COMMENT_CMD = PACKAGE_NAME + ".NEW_COMMENT";
        public const String LIKE_CMD = PACKAGE_NAME + ".NEW_LIKE";
        public const String TAG_CMD = PACKAGE_NAME + ".NEW_TAG";
        public const String REMOVE_COMMENT_CMD = PACKAGE_NAME +
                                                 ".REMOVE_COMMENT";
        public const String REMOVE_LIKE_CMD = PACKAGE_NAME + ".REMOVE_LIKE";
        public const String REMOVE_TAG_CMD = PACKAGE_NAME + ".REMOVE_TAG";
        public const String HAND_WRITTER = PACKAGE_NAME + ".IMAGE_HANDWRITE";
        public const String NEW_PHOTO = PACKAGE_NAME + ".UPLOAD_PHOTO";
        public const String PHOTO_UPLOADING = PACKAGE_NAME +
                                              ".PHOTO_UPLOADING";
        public const String GENERAL_NOTIFY = PACKAGE_NAME +
                                             ".GENERAL_NOTIFY";
        // public static final String USER_COMMENT_CMD = PACKAGE_NAME+
        // ".NEW_COMMENT_USER";
        // public static final String USER_LIKE_CMD = PACKAGE_NAME +
        // ".NEW_LIKE_USER";
        // public static final String USER_TAG_CMD = PACKAGE_NAME + ".NEW_TAG_USER";
        public const String CREATE_STATUS = PACKAGE_NAME + ".CREATE_STATUS";
        public const String STATUS_UPLOADING = PACKAGE_NAME +
                                               ".STATUS_UPLOADING";
        public const String PHOTO_UPLOAD_DONE = PACKAGE_NAME +
                                                ".PHOTO_UPLOAD_DONE";

        public const int PING_MSG = 50000;

        public class PhotoUploadStatus
        {
            public const int UPLOAD_PROGRESS = 20;
            public const int UPLOAD_COMPLETE = 21;
            public const int UPLOAD_FAIL = 22;
            public const int DOWNLOAD_PHOTO = 23;
            public const int UPLOAD_META_DATA_FAIL = 24;
        }

        public class MessageStatus
        {
            public const int SENTFAIL = 0;
            public const int SENT = 1;
            public const int RECEIVED = 2;
            public const int EMPTY = 3;
            public const int UPLOADFAIL = 4;
            public const int SENDING = 5;
            public const int UPLOADING = 6;
        }

        public class MessageType
        {
            public const int MESSAGE_SIMPLE = 1;
            public const int MESSAGE_LOCATION = 6;
            public const int MESSAGE_GROUP_CHANGE = 8;
            public const int MESSAGE_VOICE = 10;
            public const int MESSAGE_IMAGE = 12;
            public const int MESSAGE_IMAGE_ME = 13;
            public const int MESSAGE_HTML_GIF = 16;
            public const int MESSAGE_CONTACT = 20;
        }

        public const String IMAGE_CACHE_DIR = "images";
        public const String THUMB_CACHE_DIR = "thumbs";
        public const String CHOSEN_IMAGES = "ChosenImages";

        public const int INSERT_EMOJI = 0;
        public const int RESULT_CODE_1 = 1;
        public const int RESULT_CODE_2 = 2;
        public const int HANDWRITE_DOODLE = 3;
        public const int RESULT_CODE_4 = 4;
        public const int CHANGE_STATUS = 5;
        public const int PICK_IMAGE_FROM_CAMERA = 6;
        public const int PICK_IMAGE_FROM_GALLERY = 7;
        public const int CROP_IMAGE = 8;
        public const int PICK_IMAGE_FROM_LOCATION = 9;
        public const int PICK_IMAGE_FROM_CONTACT = 10;
        public const int MAKE_PHOTO_EFFECT = 11;
        public const int PICK_MULTIIMAGES_FROM_GALLERY = 12;
        public const int PICK_IMAGE_FROM_HW = 13;
        public const int RESULT_QUIT = 14;
        public const int INSERT_GIF = 15;
        public const int PICK_IMAGE_FROM_COLLECTION = 16;
        public const int CHAT_WALLPAPER = 17;

        public class FriendType
        {
            public const int FRIEND = 1;
            public const int GROUP = 8;
            public const int GROUP_HISTORY = 9;
            public const int FIND_FRIEND = 11;
            public const int LOCATION = 12;
            public const int WALA_TEAM = 2;
            public const int HOT_PHOTO = 3;
        }

        public const String KICKED_GROUP = "wala.chat.KICKED_OUT_GROUP";
        public const String UPDATE_GROUP = "wala.chat.UPDATE_GROUP";
        public const String LOAD_CONTACT_DONE = "wala.chat.LOAD_CONTACT_DONE";

        public class PhotoMode
        {
            public const int HOT = 1;
            public const int NEW = 2;
        }

        public class PrivacyKey
        {
            public const int PRIVACY_KEY_ALL = 0;
        }

        public class PrivacyValue
        {
            public const int PRIVACY_VALUE_DEFAULT = 0,
            PRIVACY_VALUE_ME = 1, PRIVACY_VALUE_FRIEND = 2,
            PRIVACY_VALUE_FRIEND_OF_FRIEND = 3, PRIVACY_VALUE_PUBLIC = 4,
            PRIVACY_VALUE_CUSTOM = 5;
        }
    }    

    public class InvitationResponseState
    {
        public const int RESPONSE_ACCEPT = 1, RESPONSE_REJECT = 2;
    }

    public class GroupMemberChangeType
    {
        public const int JOIN_GROUP = 1, LEAVE_GROUP = 2,
        KICK_GROUP = 3;
    }   

    public class UserState
    {
        public const int USER_STATE_OFFLINE = 0, USER_STATE_ONLINE = 1,
        USER_STATE_READY = 2;
    }    

    public class TimeLineErrorCode
    {
        public const int SUCCESS = 0;
        public const int DATABASE_ERROR = 1;
        public const int GLOBAL_CACHE_ERROR = 2;
        public const int TYPE_ERROR = 3;
        public const int PARSE_ERROR = 4;
        public const int KEY_NOT_FOUND_ERROR = 5;
        public const int USER_NOT_FOUND_ERROR = 6;
        public const int OBJECT_NOT_FOUND_ERROR = 7;
        public const int ALBUM_NOT_FOUND_ERROR = 8;
        public const int CATEGORY_NOT_FOUND_ERROR = 9;
        public const int FEED_NOT_FOUND_ERROR = 10;
        public const int PHOTO_NOT_FOUND_ERROR = 11;
        public const int COMMENT_NOT_FOUND_ERROR = 12;
        public const int LIKE_NOT_FOUND_ERROR = 13;
        public const int TAG_NOT_FOUND_ERROR = 14;
        public const int SHARE_NOT_FOUND_ERROR = 15;
        public const int LIKE_DUPLICATE_ERROR = 16;
        public const int TAG_DUPLICATE_ERROR = 17;
        public const int ARGUMENT_ERROR = 18;
        public const int SEND_ERROR = 19;
        public const int PRIVACY_ERROR = 20;
    }

    public class ErrorCode
    {
        // NOTE: < 10000: internal error. IF THESE ERRORS OCCUR, RETURN
        // SERVER_ERROR (10000)
        public const int
        // NOTE: < 10000: internal error. IF THESE ERRORS OCCUR, RETURN
        // SERVER_ERROR (10000)
        UNKNOWN_ERROR = 2,
        PARSE_ERROR = 3, // Error when parsing message.
        SESSION_NOT_FOUND_ERROR = 4, // Error if session not found in
        // map (user session, presence
        // session)
        SESSION_EXIST = 5,
        DATABASE_ERROR = 6, // Database error.
        DATABASE_KEY_NOT_FOUND = 7,
        DATABASE_KEY_DUP = 8,
        GLOBAL_CACHE_ERROR = 9,
        GLOBAL_CACHE_KEY_NOT_FOUND = 10,
        GLOBAL_CACHE_KEY_DUP = 11,
        CHUNK_ERROR = 12,

        SYSTEM_ERROR = 2012, // WTF

        // >= 10000: user error.
        SERVER_ERROR = 10000, // Generic error for client.

        TOKEN_ERROR = 10001,
        USER_NOT_EXIST = 10002,
        USER_EXIST = 10003,
        FRIEND_NOT_EXIST = 10004,
        FRIEND_EXIST = 10005,
        CONTACT_GROUP_NOT_EXIST = 10006,
        CONTACT_GROUP_EXIST = 10007,
        INPUT_ERROR = 10008,
        REQUEST_NOT_EXIST = 10009,
        GROUP_CHAT_NOT_EXIST = 10010,

        MULTIPLE_SIGN_IN = 10011,
        PASSWORD_COINCIDE = 10012,
        PASSWORD_INCORRECT = 10013,
        PHONE_EXIST = 10014,
        PHONE_NOT_EXIST = 10015, AUTO_ADD_FRIEND_ERROR = 10016,

        USER_SESSION_NOT_FOUND = 15000,
        MALFORM_MESSAGE = 16000,
        PROTOCOL_VERSION_NOT_MATCH = 17000, PROFILE_NOT_ACTIVE = 20000;
    }

    public class FriendState
    {
        public const int FRIEND_STATE_NORMAL = 1,
        FRIEND_STATE_PENDING = 2, FRIEND_STATE_REJECT = 3,
        FRIEND_STATE_NEW = 1000;
    }

    public class NotifyCode
    {
        public const int NOTIFY_CODE_FRIEND_ACCEPT = 1,
        NOTIFY_CODE_FRIEND_REJECT = 2, NOTIFY_CODE_AUTO_ADD_FRIEND = 3;
    }

    public class PhotoSharingNotifyCode
    {
        public const int NOTIFY_CODE_CREATE_PHOTO = 100,
        NOTIFY_CODE_CREATE_COMMENT = 101, NOTIFY_CODE_LIKE = 102,
        NOTIFY_CODE_SHARE = 103, NOTIFY_CODE_TAG = 104,
        NOTIFY_CODE_CREATE_STATUS = 105;
    }

    public class NotificationMessageType
    {
        public const int CREATE_PHOTO = 1, // "%s đã upload ảnh %s"
        CREATE_STATUS = 2, // "%s đã cập nhật trạng thái: \"%s\""
        CREATE_COMMENT_PHOTO = 3, // "%s đã bình luận lên ảnh %s của %s"
        CREATE_COMMENT_PHOTO_SELF = 4, // "%s đã bình luận lên ảnh %s của bạn"
        CREATE_COMMENT_STATUS = 5, // "%s đã bình luận lên trạng thái của %s"
        CREATE_COMMENT_STATUS_SELF = 6, // "%s đã bình luận lên trạng thái của bạn"
        LIKE_PHOTO = 7, // "%s thích ảnh %s của %s
        LIKE_PHOTO_SELF = 8, // "%s thích ảnh %s của bạn"
        LIKE_STATUS = 9, // "%s thích trạng thái của %s"
        LIKE_STATUS_SELF = 10, // "%s thích trạng thái của bạn"
        TAG_PHOTO = 11, // "%s tag %s lên ảnh %s của %s"
        TAG_PHOTO_SELF = 12, // "%s tag %s lên ảnh %s của bạn"
        TAG_PHOTO_RECIPIENT = 13, // "%s tag bạn lên ảnh %s của %s"
        TAG_PHOTO_RECIPIENT_SELF = 14, // "%s tag bạn lên ảnh %s của bạn"
        TAG_STATUS = 15, // "%s tag %s lên trạng thái của %s"
        TAG_STATUS_SELF = 16, // "%s tag %s lên trạng thái của bạn"
        TAG_STATUS_RECIPIENT = 17, // "%s tag bạn lên trạng thái của %s"
        TAG_STATUS_RECIPIENT_SELF = 18, // "%s tag bạn lên trạng thái của bạn"
        ACCEPT_FRIEND = 19, // "%s đã đồng ý kết bạn"
        REJECT_FRIEND = 20, // "%s đã từ chối kết bạn"
        AUTO_ADD_USER_FRIEND_0 = 21, // "Không tìm thấy bạn trong phone book"
        AUTO_ADD_USER_FRIEND_1 = 22, // "%s đã tham gia hệ thống"
        AUTO_ADD_USER_FRIEND_2 = 23, // "Bạn đã kết bạn với %s và %s"
        AUTO_ADD_USER_FRIEND_3 = 24; // "Bạn đã kết bạn với %s, %s và %d người khác"
    }

    public class UserProfileStatus
    {
        public const int USER_PROFILE_STATUS_ACTIVE = 1,
        USER_PROFILE_STATUS_INACTIVE = 2,
        USER_PROFILE_STATUS_BANNED = 3;
    }

    public class PresenceCode
    {
        public const uint PRESENCE_OFFLINE = 0, PRESENCE_INVISIBLE = 1,
        PRESENCE_AVAILABLE = 2, PRESENCE_BUSY = 3, PRESENCE_IDLE = 4;
    }

    public class Response
    {
        public const int DONT_KNOWN_HOST = -1,
        COULD_NOT_IO_TO_HOST = -2, CONECTION_LOST = -3,
        CONECTION_SUCCESS = 0, SEVER_RESPONSE = 1,
        TIMEOUT_CONNECTION = -4, SEND_LOGOUT_SUCCESS = 2;
    }

    public class Gender
    {
        public const int GENDER_UNDEFINED = 0, GENDER_MALE = 1,
        GENDER_FEMALE = 2;
    }

    public class Sort
    {
        public const int SORT_BY_DISTANCE = 0, SORT_BY_TIME = 1;
    }

    public class PhotoUploadStatus
    {
        public const int UPLOAD_PROGRESS = 20;
        public const int UPLOAD_COMPLETE = 21;
        public const int UPLOAD_FAIL = 22;
        public const int DOWNLOAD_PHOTO = 23;
        public const int UPLOAD_META_DATA_FAIL = 24;
    }

    public class MessageStatus
    {
        public const int SENTFAIL = 0;
        public const int SENT = 1;
        public const int RECEIVED = 2;
        public const int EMPTY = 3;
        public const int UPLOADFAIL = 4;
        public const int SENDING = 5;
        public const int UPLOADING = 6;
    }

    public class MessageType
    {
        public const int MESSAGE_SIMPLE = 1;
        public const int MESSAGE_LOCATION = 6;
        public const int MESSAGE_GROUP_CHANGE = 8;
        public const int MESSAGE_VOICE = 10;
        public const int MESSAGE_IMAGE = 12;
        public const int MESSAGE_IMAGE_ME = 13;
        public const int MESSAGE_HTML_GIF = 16;
        public const int MESSAGE_CONTACT = 20;
    }

    public class FriendType
    {
        public const int FRIEND = 1;
        public const int GROUP = 8;
        public const int GROUP_HISTORY = 9;
        public const int FIND_FRIEND = 11;
        public const int LOCATION = 12;
        public const int WALA_TEAM = 2;
        public const int HOT_PHOTO = 3;
    }

    public class PhotoMode
    {
        public const int HOT = 1;
        public const int NEW = 2;
    }

    public class PrivacyKey
    {
        public const int PRIVACY_KEY_ALL = 0;
    }

    public class PrivacyValue
    {
        public const int PRIVACY_VALUE_DEFAULT = 0,
        PRIVACY_VALUE_ME = 1, PRIVACY_VALUE_FRIEND = 2,
        PRIVACY_VALUE_FRIEND_OF_FRIEND = 3, PRIVACY_VALUE_PUBLIC = 4,
        PRIVACY_VALUE_CUSTOM = 5;
    }

    public class ClientMessageType
    {
        public const int
        // Login logout
        RET_LOGIN_SUCCESS_MSG = 100,
        RET_LOGIN_ERROR_MSG = 101,
        RET_LOGOUT_SUCCESS_MSG = 102,
        RET_LOGOUT_ERROR_MSG = 103,
        RET_RECONNECT_SUCCESS_MSG = 104,
        RET_RECONNECT_ERROR_MSG = 105,
        // Load contact etc...
        RET_LOAD_CONTACT_SUCCESS_MSG = 110,
        RET_LOAD_CONTACT_ERROR_MSG = 111,
        RET_LOAD_PRESENCE_SUCCESS_MSG = 112,
        RET_LOAD_PRESENCE_ERROR_MSG = 113,
        RET_LOAD_FRIEND_BASIC_SUCCESS_MSG = 114,
        RET_LOAD_FRIEND_BASIC_ERROR_MSG = 115,
        RET_LOAD_FRIEND_DETAIL_SUCCESS_MSG = 116,
        RET_LOAD_FRIEND_DETAIL_ERROR_MSG = 117,
        RET_LOAD_FRIEND_PRESENCE_SUCCESS_MSG = 118,
        RET_LOAD_FRIEND_PRESENCE_ERROR_MSG = 119,
        // User profile
        RET_GET_USER_SUCCESS_MSG = 120,
        RET_GET_USER_ERROR_MSG = 121,
        RET_UPDATE_USER_INFO_SUCCESS_MSG = 122,
        RET_UPDATE_USER_INFO_ERROR_MSG = 123,
        RET_CHANGE_PASSWORD_SUCCESS_MSG = 124,
        RET_CHANGE_PASSWORD_ERROR_MSG = 125,
        RET_UPDATE_AVATAR_SUCCESS_MSG = 126,
        RET_UPDATE_AVATAR_ERROR_MSG = 127,
        RET_UPDATE_COVER_SUCCESS_MSG = 128,
        RET_UPDATE_COVER_ERROR_MSG = 129,
        // Friend
        RET_ADD_FRIEND_SUCCESS_MSG = 130,
        RET_ADD_FRIEND_ERROR_MSG = 131,
        RET_DELETE_FRIEND_SUCCESS_MSG = 132,
        RET_DELETE_FRIEND_ERROR_MSG = 133,
        RET_ACCEPT_FRIEND_SUCCESS_MSG = 134,
        RET_ACCEPT_FRIEND_ERROR_MSG = 135,
        RET_REJECT_FRIEND_SUCCESS_MSG = 136,
        RET_REJECT_FRIEND_ERROR_MSG = 137,
        RET_ADD_FRIEND_ID_SUCCESS_MSG = 138,
        RET_ADD_FRIEND_ID_ERROR_MSG = 139,
        RET_SET_FRIEND_ALIAS_SUCCESS_MSG = 140,
        RET_SET_FRIEND_ALIAS_ERROR_MSG = 141,
        RET_SET_FRIEND_ALIAS_LIST_SUCCESS_MSG = 142,
        RET_SET_FRIEND_ALIAS_LIST_ERROR_MSG = 143,
        RET_GET_PENDING_FRIEND_SUCCESS_MSG = 144,
        RET_GET_PENDING_FRIEND_ERROR_MSG = 145,
        // Contact group
        RET_ADD_CONTACT_GROUP_SUCCESS_MSG = 150,
        RET_ADD_CONTACT_GROUP_ERROR_MSG = 151,
        RET_UPDATE_CONTACT_GROUP_SUCCESS_MSG = 152,
        RET_UPDATE_CONTACT_GROUP_ERROR_MSG = 153,
        RET_DELETE_CONTACT_GROUP_SUCCESS_MSG = 154,
        RET_DELETE_CONTACT_GROUP_ERROR_MSG = 155,
        RET_ADD_USER_CG_SUCCESS_MSG = 156,
        RET_ADD_USER_CG_ERROR_MSG = 157,
        RET_DELETE_USER_CG_SUCCESS_MSG = 158,
        RET_DELETE_USER_CG_ERROR_MSG = 159,
        RET_MOVE_USER_CG_SUCCESS_MSG = 160,
        RET_MOVE_USER_CG_ERROR_MSG = 161,
        // Status
        RET_UPDATE_PRESENCE_SUCCESS_MSG = 170,
        RET_UPDATE_PRESENCE_ERROR_MSG = 171,
        // Register phone book
        RET_REGISTER_PHONEBOOK_SUCCESS_MSG = 180,
        RET_REGISTER_PHONEBOOK_ERROR_MSG = 181,
        // Chat
        RET_SEND_PAIR_CHAT_SUCCESS_MSG = 200,
        RET_SEND_PAIR_CHAT_ERROR_MSG = 201,
        RECV_PAIR_CHAT_MSG = 202,
        // Group chat
        RET_CREATE_GROUP_SUCCESS_MSG = 203,
        RET_CREATE_GROUP_ERROR_MSG = 204,
        RET_INVITE_TO_GROUP_SUCCESS_MSG = 205,
        RET_INVITE_TO_GROUP_ERROR_MSG = 206,
        RET_RESPONSE_GROUP_INVITATION_SUCCESS_MSG = 207,
        RET_RESPONSE_GROUP_INVITATION_ERROR_MSG = 208,
        RET_LEAVE_GROUP_SUCCESS_MSG = 209,
        RET_LEAVE_GROUP_ERROR_MSG = 210,
        RET_SEND_GROUP_CHAT_SUCCESS_MSG = 211,
        RET_SEND_GROUP_CHAT_ERROR_MSG = 212,
        RECV_GROUP_CHAT_MSG = 213,
        RET_GET_GROUP_MEMBER_LIST_SUCCESS_MSG = 214,
        RET_GET_GROUP_MEMBER_LIST_ERROR_MSG = 215,
        RET_REMOVE_GROUP_MEMBER_SUCCESS_MSG = 216,
        RET_REMOVE_GROUP_MEMBER_ERROR_MSG = 217,
        // Location chat
        RET_SET_LOCATION_SUCCESS_MSG = 300,
        RET_SET_LOCATION_ERROR_MSG = 301,
        RET_REMOVE_LOCATION_SUCCESS_MSG = 302,
        RET_REMOVE_LOCATION_ERROR_MSG = 303,
        RET_SEARCH_LOCATION_CHAT_SUCCESS_MSG = 304,
        RET_SEARCH_LOCATION_CHAT_ERROR_MSG = 305,
        // Offline
        RET_PAIR_OFFLINE_MSG = 400,
        RET_GROUP_OFFLINE_MSG = 401,
        // Conversation group
        RET_LOAD_CONVERSATION_GROUP_SUCCESS_MSG = 410,
        RET_LOAD_CONVERSATION_GROUP_ERROR_MSG = 411,
        RET_ADD_CONVERSATION_GROUP_SUCCESS_MSG = 412,
        RET_ADD_CONVERSATION_GROUP_ERROR_MSG = 413,
        RET_UPDATE_CONVERSATION_GROUP_SUCCESS_MSG = 414,
        RET_UPDATE_CONVERSATION_GROUP_ERROR_MSG = 415,
        RET_DELETE_CONVERSATION_GROUP_SUCCESS_MSG = 416,
        RET_DELETE_CONVERSATION_GROUP_ERROR_MSG = 417,
        // Notify message to client
        NOTIFY_ONLINE_MSG = 500,
        NOTIFY_OFFLINE_MSG = 501,
        NOTIFY_FRIEND_REQUEST_MSG = 502,
        NOTIFY_GENERAL_MSG = 503,
        NOTIFY_UPDATE_PRESENCE_MSG = 504,
        NOTIFY_PAIR_OFFLINE_MSG = 505,
        NOTIFY_INVITE_TO_GROUP_MSG = 506,
        NOTIFY_GROUP_OFFLINE_MSG = 507,
        NOTIFY_GROUP_CHANGE_MSG = 508,
        NOTIFY_UPDATE_AVATAR_MSG = 509,
        NOTIFY_UPDATE_COVER_MSG = 510,
        // Kick message
        KICK_MSG = 600,
        CLIENT_PONG_SUCCESS_MSG = 601,
        CLIENT_PONG_ERROR_MSG = 602,
        // Misc
        RET_GET_SHORT_PROFILE_SUCCESS_MSG = 700,
        RET_GET_SHORT_PROFILE_ERROR_MSG = 701,
        RET_GET_SHORT_PROFILE_LIST_SUCCESS_MSG = 702,
        RET_GET_SHORT_PROFILE_LIST_ERROR_MSG = 703,
        // Privacy
        RET_SET_USER_PRIVACY_SUCCESS_MSG = 710,
        RET_SET_USER_PRIVACY_ERROR_MSG = 711,
        RET_GET_USER_PRIVACY_SUCCESS_MSG = 712,
        RET_GET_USER_PRIVACY_ERROR_MSG = 713,
        RET_BLOCK_USER_SUCCESS_MSG = 714,
        RET_BLOCK_USER_ERROR_MSG = 715,
        RET_UNBLOCK_USER_SUCCESS_MSG = 716,
        RET_UNBLOCK_USER_ERROR_MSG = 717,
        // IOS
        RET_IOS_HOME_SUCCESS_MSG = 720,
        RET_IOS_HOME_ERROR_MSG = 721,
        RET_IOS_ALIVE_SUCCESS_MSG = 722, RET_IOS_ALIVE_ERROR_MSG = 723;
    }   

    
    public class CommMessageType
    {
        // Message to com server: 1001 - 2000
        public const int
        // Message send from client
        // Login logout
        LOGIN_MSG = 1001,
        LOGOUT_MSG = 1002,
        RECONNECT_MSG = 1003,
        // Load contact etc...
        LOAD_CONTACT_MSG = 1010,
        LOAD_PRESENCE_MSG = 1011,
        LOAD_FRIEND_BASIC_MSG = 1012,
        LOAD_FRIEND_DETAIL_MSG = 1013,
        LOAD_FRIEND_PRESENCE_MSG = 1014,
        // User profile
        GET_USER_MSG = 1020,
        UPDATE_USER_INFO_MSG = 1021,
        CHANGE_PASSWORD_MSG = 1022,
        UPDATE_AVATAR_MSG = 1023,
        UPDATE_COVER_MSG = 1024,
        // Privacy
        SET_USER_PRIVACY_MSG = 1025,
        GET_USER_PRIVACY_MSG = 1026,
        BLOCK_USER_MSG = 1027,
        UNBLOCK_USER_MSG = 1028,
        // Friend
        ADD_FRIEND_MSG = 1030,
        DELETE_FRIEND_MSG = 1031,
        ACCEPT_FRIEND_MSG = 1032,
        REJECT_FRIEND_MSG = 1033,
        ADD_FRIEND_ID_MSG = 1034,
        SET_FRIEND_ALIAS_MSG = 1035,
        SET_FRIEND_ALIAS_LIST_MSG = 1036,
        GET_PENDING_FRIEND_MSG = 1037,
        // Contact group
        ADD_CONTACT_GROUP_MSG = 1040,
        UPDATE_CONTACT_GROUP_MSG = 1041,
        DELETE_CONTACT_GROUP_MSG = 1042,
        ADD_USER_CG_MSG = 1043,
        DELETE_USER_CG_MSG = 1044,
        MOVE_USER_CG_MSG = 1045,
        // Status
        UPDATE_PRESENCE_MSG = 1050,
        // Load offline message
        LOAD_OFFLINE_MSG = 1051,
        // Register phone book
        REGISTER_PHONEBOOK_MSG = 1052,
        // Chat
        SEND_PAIR_CHAT_MSG = 1053,
        // Group chat
        CREATE_GROUP_MSG = 1060,
        INVITE_TO_GROUP_MSG = 1061,
        RESPONSE_GROUP_INVITATION_MSG = 1062,
        LEAVE_GROUP_MSG = 1063,
        SEND_GROUP_CHAT_MSG = 1064,
        GET_GROUP_MEMBER_LIST_MSG = 1065,
        REMOVE_GROUP_MEMBER_MSG = 1066,
        // Location chat
        SET_LOCATION_MSG = 1070,
        REMOVE_LOCATION_MSG = 1071,
        SEARCH_LOCATION_CHAT_MSG = 1072,
        // Misc
        GET_SHORT_PROFILE_MSG = 1080,
        GET_SHORT_PROFILE_LIST_MSG = 1081,
        CLIENT_PING_MSG = 1090,
        // Conversation group
        LOAD_CONVERSATION_GROUP_MSG = 1091,
        ADD_CONVERSATION_GROUP_MSG = 1092,
        UPDATE_CONVERSATION_GROUP_MSG = 1093,
        DELETE_CONVERSATION_GROUP_MSG = 1094,
        // IOS
        IOS_HOME_MSG = 1095,
        IOS_ALIVE_MSG = 1096,

        // Return message from presence server
        // Login logout
        RET_INIT_PRESENCE_SUCCESS_MSG = 1100,
        RET_INIT_PRESENCE_ERROR_MSG = 1101,
        RET_TERMINATE_PRESENCE_SUCCESS_MSG = 1102,
        RET_TERMINATE_PRESENCE_ERROR_MSG = 1103,
        RET_RECONNECT_SUCCESS_MSG = 1104,
        RET_RECONNECT_ERROR_MSG = 1105,
        // Load contact etc...
        RET_LOAD_CONTACT_SUCCESS_MSG = 1110,
        RET_LOAD_CONTACT_ERROR_MSG = 1111,
        RET_LOAD_PRESENCE_SUCCESS_MSG = 1112,
        RET_LOAD_PRESENCE_ERROR_MSG = 1113,
        RET_LOAD_FRIEND_BASIC_SUCCESS_MSG = 1114,
        RET_LOAD_FRIEND_BASIC_ERROR_MSG = 1115,
        RET_LOAD_FRIEND_DETAIL_SUCCESS_MSG = 1116,
        RET_LOAD_FRIEND_DETAIL_ERROR_MSG = 1117,
        RET_LOAD_FRIEND_PRESENCE_SUCCESS_MSG = 1118,
        RET_LOAD_FRIEND_PRESENCE_ERROR_MSG = 1119,
        // User profile
        RET_GET_USER_SUCCESS_MSG = 1120,
        RET_GET_USER_ERROR_MSG = 1121,
        RET_ADD_USER_SUCCESS_MSG = 1122,
        RET_ADD_USER_ERROR_MSG = 1123,
        RET_UPDATE_USER_PROFILE_SUCCESS_MSG = 1124,
        RET_UPDATE_USER_PROFILE_ERROR_MSG = 1125,
        RET_UPDATE_USER_INFO_SUCCESS_MSG = 1126,
        RET_UPDATE_USER_INFO_ERROR_MSG = 1127,
        RET_CHANGE_PASSWORD_SUCCESS_MSG = 1128,
        RET_CHANGE_PASSWORD_ERROR_MSG = 1129,
        RET_DELETE_USER_SUCCESS_MSG = 1130,
        RET_DELETE_USER_ERROR_MSG = 1131,
        RET_UPDATE_AVATAR_SUCCESS_MSG = 1132,
        RET_UPDATE_AVATAR_ERROR_MSG = 1133,
        RET_UPDATE_COVER_SUCCESS_MSG = 1134,
        RET_UPDATE_COVER_ERROR_MSG = 1135,
        RET_NEW_PASSWORD_SUCCESS_MSG = 1136,
        RET_NEW_PASSWORD_ERROR_MSG = 1137,
        // Friend
        RET_ADD_FRIEND_SUCCESS_MSG = 1140,
        RET_ADD_FRIEND_ERROR_MSG = 1141,
        RET_DELETE_FRIEND_SUCCESS_MSG = 1142,
        RET_DELETE_FRIEND_ERROR_MSG = 1143,
        RET_ACCEPT_FRIEND_SUCCESS_MSG = 1144,
        RET_ACCEPT_FRIEND_ERROR_MSG = 1145,
        RET_REJECT_FRIEND_SUCCESS_MSG = 1146,
        RET_REJECT_FRIEND_ERROR_MSG = 1147,
        RET_ADD_FRIEND_ID_SUCCESS_MSG = 1148,
        RET_ADD_FRIEND_ID_ERROR_MSG = 1149,
        RET_SET_FRIEND_ALIAS_SUCCESS_MSG = 1150,
        RET_SET_FRIEND_ALIAS_ERROR_MSG = 1151,
        RET_SET_FRIEND_ALIAS_LIST_SUCCESS_MSG = 1152,
        RET_SET_FRIEND_ALIAS_LIST_ERROR_MSG = 1153,
        RET_GET_PENDING_FRIEND_SUCCESS_MSG = 1154,
        RET_GET_PENDING_FRIEND_ERROR_MSG = 1155,
        // Contact group
        RET_ADD_CONTACT_GROUP_SUCCESS_MSG = 1160,
        RET_ADD_CONTACT_GROUP_ERROR_MSG = 1161,
        RET_UPDATE_CONTACT_GROUP_SUCCESS_MSG = 1162,
        RET_UPDATE_CONTACT_GROUP_ERROR_MSG = 1163,
        RET_DELETE_CONTACT_GROUP_SUCCESS_MSG = 1164,
        RET_DELETE_CONTACT_GROUP_ERROR_MSG = 1165,
        RET_ADD_USER_CG_SUCCESS_MSG = 1166,
        RET_ADD_USER_CG_ERROR_MSG = 1167,
        RET_DELETE_USER_CG_SUCCESS_MSG = 1168,
        RET_DELETE_USER_CG_ERROR_MSG = 1169,
        RET_MOVE_USER_CG_SUCCESS_MSG = 1170,
        RET_MOVE_USER_CG_ERROR_MSG = 1171,
        // Status
        RET_UPDATE_PRESENCE_SUCCESS_MSG = 1180,
        RET_UPDATE_PRESENCE_ERROR_MSG = 1181,
        // Register phone book
        RET_REGISTER_PHONEBOOK_SUCCESS_MSG = 1190,
        RET_REGISTER_PHONEBOOK_ERROR_MSG = 1191,

        // Return message from channel server
        // Chat
        RET_SEND_PAIR_CHAT_SUCCESS_MSG = 1200,
        RET_SEND_PAIR_CHAT_ERROR_MSG = 1201,
        RECV_PAIR_CHAT_MSG = 1202,
        // Group chat
        RET_CREATE_GROUP_SUCCESS_MSG = 1203,
        RET_CREATE_GROUP_ERROR_MSG = 1204,
        RET_INVITE_TO_GROUP_SUCCESS_MSG = 1205,
        RET_INVITE_TO_GROUP_ERROR_MSG = 1206,
        RET_RESPONSE_GROUP_INVITATION_SUCCESS_MSG = 1207,
        RET_RESPONSE_GROUP_INVITATION_ERROR_MSG = 1208,
        RET_LEAVE_GROUP_SUCCESS_MSG = 1209,
        RET_LEAVE_GROUP_ERROR_MSG = 1210,
        RET_GROUP_CHANGE_SUCCESS_MSG = 1211,
        RET_GROUP_CHANGE_ERROR_MSG = 1212,
        RET_SEND_GROUP_CHAT_SUCCESS_MSG = 1215,
        RET_SEND_GROUP_CHAT_ERROR_MSG = 1216,
        RECV_GROUP_CHAT_MSG = 1217,
        RET_GET_GROUP_MEMBER_LIST_SUCCESS_MSG = 1218,
        RET_GET_GROUP_MEMBER_LIST_ERROR_MSG = 1219,
        RET_REMOVE_GROUP_MEMBER_SUCCESS_MSG = 1220,
        RET_REMOVE_GROUP_MEMBER_ERROR_MSG = 1221,

        // Return message from location chat server
        RET_SET_LOCATION_SUCCESS_MSG = 1300,
        RET_SET_LOCATION_ERROR_MSG = 1301,
        RET_REMOVE_LOCATION_SUCCESS_MSG = 1302,
        RET_REMOVE_LOCATION_ERROR_MSG = 1303,
        RET_SEARCH_LOCATION_CHAT_SUCCESS_MSG = 1304,
        RET_SEARCH_LOCATION_CHAT_ERROR_MSG = 1305,

        // Offline message
        RET_GROUP_OFFLINE_MSG = 1401,
        RET_PAIR_OFFLINE_MSG = 1402,

        // Notify message to client
        // From presence server
        NOTIFY_ONLINE_MSG = 1500,
        NOTIFY_OFFLINE_MSG = 1501,
        NOTIFY_FRIEND_REQUEST_MSG = 1502,
        NOTIFY_GENERAL_MSG = 1503,
        NOTIFY_UPDATE_PRESENCE_MSG = 1504,
        NOTIFY_UPDATE_AVATAR_MSG = 1505,
        NOTIFY_UPDATE_COVER_MSG = 1506,
        // From channel server
        NOTIFY_PAIR_OFFLINE_MSG = 1510,
        NOTIFY_GROUP_OFFLINE_MSG = 1511,
        NOTIFY_INVITE_TO_GROUP_MSG = 1512,
        NOTIFY_GROUP_CHANGE_MSG = 1513,
        NOTIFY_GENERAL_LIST_MSG = 1514,

        // Special messages
        FORCE_KICK_MSG = 1520,
        ADMIN_KICK_USER_MSG = 1521,
        ADMIN_CHECK_COM_STATUS_MSG = 1522,

        // Misc
        RET_GET_SHORT_PROFILE_SUCCESS_MSG = 1600,
        RET_GET_SHORT_PROFILE_ERROR_MSG = 1601,
        RET_GET_SHORT_PROFILE_LIST_SUCCESS_MSG = 1602,
        RET_GET_SHORT_PROFILE_LIST_ERROR_MSG = 1603,

        // conversation group
        RET_LOAD_CONVERSATION_GROUP_SUCCESS_MSG = 1700,
        RET_LOAD_CONVERSATION_GROUP_ERROR_MSG = 1701,
        RET_ADD_CONVERSATION_GROUP_SUCCESS_MSG = 1702,
        RET_ADD_CONVERSATION_GROUP_ERROR_MSG = 1703,
        RET_UPDATE_CONVERSATION_GROUP_SUCCESS_MSG = 1704,
        RET_UPDATE_CONVERSATION_GROUP_ERROR_MSG = 1705,
        RET_DELETE_CONVERSATION_GROUP_SUCCESS_MSG = 1706,
        RET_DELETE_CONVERSATION_GROUP_ERROR_MSG = 1707,

        // Privacy
        RET_SET_USER_PRIVACY_SUCCESS_MSG = 1710,
        RET_SET_USER_PRIVACY_ERROR_MSG = 1711,
        RET_GET_USER_PRIVACY_SUCCESS_MSG = 1712,
        RET_GET_USER_PRIVACY_ERROR_MSG = 1713,
        RET_BLOCK_USER_SUCCESS_MSG = 1714,
        RET_BLOCK_USER_ERROR_MSG = 1715,
        RET_UNBLOCK_USER_SUCCESS_MSG = 1716,
        RET_UNBLOCK_USER_ERROR_MSG = 1717;
    }

    
}